using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityGameFramework.Runtime;

namespace Adventure
{
    public class InteractionCheck : MonoBehaviour
    {
        public bool isGround;

        [SerializeField]
        private Vector2 groundOffset;
        [SerializeField]
        private float groundCheckRadius;

        private void Awake()
        {
            groundOffset = Vector2.zero;
            groundCheckRadius = 0.25f;
        }

        private void Update()
        {
            isGround = Physics2D.OverlapCircle((Vector2)transform.position + groundOffset, groundCheckRadius, 1 << Constant.Layer.GroundId);
        }

        private void OnDrawGizmos()
        {
            Gizmos.color = Color.red;
            Gizmos.DrawWireSphere((Vector2)transform.position + groundOffset, groundCheckRadius);
        }
     
       
    }
}